﻿using System.Collections.Generic;
using Newtonsoft.Json;

namespace T.FAS.Runtime.Metadata.Entity.MF
{
    public class IfElseNode : NodeBase
    {
        [JsonProperty("data")]
        public new IfElseNodeData Data { get; set; }
    }

   
    public class IfElseNodeData
    {
        [JsonProperty("label")]
        public string Label { get; set; }

        [JsonProperty("description")]
        public string Description { get; set; }
        [JsonProperty("falseLabel")]
        public string FalseLabel { get; set; }
        [JsonProperty("status")]
        public string Status { get; set; }
        [JsonProperty("trueLabel")]
        public string TrueLabel { get; set; }
        [JsonProperty("case")]
        public List<CaseNodeData> Cases { get; set; }
    }

    public class CaseNodeData
    {
        [JsonProperty("case_id")]
        public string CaseID { get; set; }

        [JsonProperty("id")]
        public string ID { get; set; }
        [JsonProperty("conditions")]
        public List<ConditionNodeData> Conditions { get; set; }

        [JsonProperty("label")]
        public string Label { get; set; }
        [JsonProperty("logical_operator")]
        public string LogicalOperator { get; set; }
    }

    public class ConditionNodeData
    {
        [JsonProperty("dataType")]
        public string DataType { get; set; }

        [JsonProperty("operator")]
        public string Operator { get; set; }

        //左侧比较的值
        [JsonProperty("nodeId")]
        public string NodeID { get; set; }

        [JsonProperty("variable")]
        public string Variable { get; set; }


        //右侧比较的值
        [JsonProperty("valueType")]
        public string ValueType { get; set; }

        [JsonProperty("constantValue")]
        public string ConstantValue { get; set; }

        [JsonProperty("variableId")]
        public string VariableID { get; set; }

        [JsonProperty("variableNodeId")]
        public string VariableNodeID { get; set; }

        [JsonProperty("variableValue")]
        public string VariableValue { get; set; }

        [JsonProperty("variableValueId")]
        public string VariableValueID { get; set; }

    }
}
